
class MyValue{
   public int a;
}




public class Test {

    public static void swap(MyValue myValue1,MyValue myValue2){
        int tmp=myValue1.a;
        myValue1.a=myValue2.a;
        myValue2.a=tmp;

    }

    public static void main(String[] args) {

        MyValue value1=new MyValue();
        value1.a=1;
        MyValue value2=new MyValue();
        value2.a=2;
        System.out.print(value1.a+" "+value2.a );

        swap(value1,value2);
        System.out.println();
        System.out.println("=================");
        System.out.print(value1.a+" "+value2.a );


    }

}















